package top.stmo.stmoBlog.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.stmo.stmoBlog.dao.pojo.Admin;
import top.stmo.stmoBlog.service.AdminService;
import top.stmo.stmoBlog.service.LoginService;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private AdminService adminService;

    @Override
    public Admin login(String username, String password) {
        if(StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
            return null;
        }
        Admin admin = adminService.checkAdmin(username,password);
        return admin;
    }
}
